import request from '@/utils/request'

// 查询退休人员补贴工资列表
export function listRetiresPayroll(query) {
  return request({
    url: '/compensationManagement/retiresPayroll/list',
    method: 'get',
    params: query
  })
}

// 查询自身补贴工资列表
export function listSelfRetiresPayroll(query) {
  return request({
    url: '/compensationManagement/viewSelfRetiresPayroll/list',
    method: 'get',
    params: query
  })
}

// 查询退休人员补贴工资详细
export function getRetiresPayroll(retireespayrollId) {
  return request({
    url: '/compensationManagement/retiresPayroll/' + retireespayrollId,
    method: 'get'
  })
}

// 查询退休人员补贴工资详细
export function getSelfRetiresPayroll(retireespayrollId) {
  return request({
    url: '/compensationManagement/viewSelfRetiresPayroll/' + retireespayrollId,
    method: 'get'
  })
}

// 新增退休人员补贴工资
export function addRetiresPayroll(data) {
  return request({
    url: '/compensationManagement/retiresPayroll',
    method: 'post',
    data: data
  })
}

// 修改退休人员补贴工资
export function updateRetiresPayroll(data) {
  return request({
    url: '/compensationManagement/retiresPayroll',
    method: 'put',
    data: data
  })
}

// 删除退休人员补贴工资
export function delRetiresPayroll(retireespayrollId) {
  return request({
    url: '/compensationManagement/retiresPayroll/' + retireespayrollId,
    method: 'delete'
  })
}

// 读取浮动项目 （添加）
export function getAllFloatingItems() {
  return request({
    url: '/compensationManagement/setRetireeSubsidyItems/getAllFloatingItems/' ,
    method: 'get'
  })
}

// 确定退休人员补贴工资
export function determiningPayrollRetirees(data) {
  return request({
    url: '/compensationManagement/retiresPayroll/determiningPayrollRetirees',
    method: 'put',
    data: data
  })
}


export function getNickNameByJobNumber(jobNumber) {
  return request({
    url: '/compensationManagement/retiresPayroll/getNickNameByJobNumber/' + jobNumber,
    method: 'get'
  })
}
